package cn.tedu.carehome.foundation.service.impl;


import cn.tedu.carehome.foundation.ex.ServiceException;
import cn.tedu.carehome.foundation.mapper.*;

import cn.tedu.carehome.foundation.pojo.vo.RoleCountVO;
import cn.tedu.carehome.foundation.pojo.vo.VisitorWeekCountVO;
import cn.tedu.carehome.foundation.service.IStaticService;

import cn.tedu.carehome.foundation.web.ServiceCode;
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
@Slf4j
public  class StaticServiceImpl implements IStaticService {
    @Autowired
    StaticMapper staticMapper;


    @Override
    public int StaffCount() {
        return staticMapper.StaffCount();
    }

    @Override
    public int StaffCountByRole(String role) {
        //判断参数是否存在
        int staffCountByRole=staticMapper.StaffCountByRole(role);
        if (staffCountByRole==0){
            String message="查询失败,该角色名称不存在!";
            log.debug(message);
            throw new ServiceException(ServiceCode.ERR_NOT_FOUND,message);
        }
        return staffCountByRole;
    }

    @Override
    public int MedicineCount() {
        return staticMapper.MedicineCount();
    }

    @Override
    public int FoodCount() {
        return staticMapper.FoodCount();
    }

    @Override
    public int FloorCount() {
        return staticMapper.FloorCount();
    }

    @Override
    public int BedCount() {
        return staticMapper.BedCount();
    }

    @Override
    public int OlderCount() {
        return staticMapper.OlderCount();
    }

    @Override
    public int IllCount() {
        return staticMapper.IllCount();
    }

    @Override
    public int visitorCount() {
        return staticMapper.visitorCount();
    }

    @Override
    public int NocheckCount() {
        return staticMapper.NocheckCount();
    }

    @Override
    public int checkCount() {
        return staticMapper.checkCount();
    }

    @Override
    public Integer[]  floorList() {
        return staticMapper.floorList();
    }

    @Override
    public Integer[]  floorCountList() {
        return staticMapper.floorCountList();
    }

    @Override
    public Integer[] floorBedCount() {
        return staticMapper.floorBedCount();
    }

    @Override
    public List<VisitorWeekCountVO> visitorWeekCount() {
        return staticMapper.visitorWeekCount();
    }

    @Override
    public List<RoleCountVO> roleCount() {
        return staticMapper.roleCount();
    }
}
